﻿
using System.Collections.Generic;

namespace LxCFD
{
    public class TypicalEquationGroup : SolvableUnitGroup<TypicalEquationUnit>
    {
        public List<EquationBase> Equations = new List<EquationBase>();
        public List<ConnectBase> Connects = new List<ConnectBase>();
        public override void Rearrange(ConnectivityAnalysis connectivityAnalysis)
        {
            Units = new List<TypicalEquationUnit>();
            var list = connectivityAnalysis.SplitByConnectivity(Equations, Connects);
            foreach (var l in list)
            {
                TypicalEquationUnit u = new TypicalEquationUnit();
                u.CreateUnit(l.Zones, l.Contacts, SolverType);
                Units.Add(u);
            }
            Equations.Clear();
            Connects.Clear();
        }
    }
}